﻿using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    public abstract class CardUseComponent : ComponentDB, ICardUse, IIfCardUse
    {
        protected BattleCard baseCard;

        [BsonIgnore]
        public abstract string UseInfo { get; set; }

        public void Awake()
        {
            baseCard = GetEntity<BattleCard>();
            baseCard.IfUseDic.Add(this);
            baseCard.AddUse(this);
        }

        public abstract bool IfUse(FightModel fightModel, BattlePlayer user);
        public abstract void Use(FightModel fightModel, BattlePlayer user);
    }
}
